#include<bits/stdc++.h>
using namespace std;

int r[100005],n1,n2,tong[100005],k;
vector<int> v;

int main(){
    freopen("duel.in","r",stdin);
    freopen("duel.out","w",stdout);
    int n;
    cin>>n;
    for(int i=1;i<=n;i++){
        cin>>r[i];
        if(tong[r[i]]==0){
            k++;
            v.push_back(r[i]);
        }
        tong[r[i]]++;
    }
    if(k==2){
        int ans=max(tong[v[0]],tong[v[1]]);
        cout<<ans;
        return 0;
    }
    sort(r,r+n);
    return 0;
}
